<script type="text/javascript">
  function getUrlParam (name) {
    let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)') // 构造一个含有目标参数的正则表达式对象
    let r = window.location.search.substr(1).match(reg)  // 匹配目标参数
    if (r != null) return unescape(r[2])
    return null // 返回参数值
  }

  let accessToken = getUrlParam('accessToken')
  let refreshToken = getUrlParam('refreshToken')
  let expiry = getUrlParam('expiry')

  // 调用父窗口登录成功方法
  parent.window.loginSuccess(accessToken, refreshToken, expiry)
</script>
